Built-in module imageop

imageop The imageop module contains some useful operations on images. It operates on images consisting of 8 or 32 bit pixels stored in python strings. This is the same format as used by gl.lrectwrite and the imgfile module. The module defines the following variables and functions:
\begin{excdesc}{error}
This exception is raised on all errors, such as unknown number of bits
per pixel, etc.
\end{excdesc}

\begin{funcdesc}{crop}{image\, psize\, width\, height\, x0\, y0\, x1\, y1}
This ...
... the new image is mirrored. The
same holds for the y coordinates.
\end{funcdesc}

\begin{funcdesc}{scale}{image\, psize\, width\, height\, newwidth\, newheight}
T...
...rated
images or dithered images will not look nice after scaling.
\end{funcdesc}

\begin{funcdesc}{tovideo}{image\, psize\, width\, height}
This function runs a v...
...isplayed on a video
device that uses interlacing, hence the name.
\end{funcdesc}

\begin{funcdesc}{grey2mono}{image\, width\, height\, threshold}
This function co...
...d and is probably only useful as an argument to \code{mono2grey}.
\end{funcdesc}

\begin{funcdesc}{dither2mono}{image\, width\, height}
This function also convert...
...nochrome image but it uses a (simple-minded) dithering algorithm.
\end{funcdesc}

\begin{funcdesc}{mono2grey}{image\, width\, height\, p0\, p1}
This function conv...
...o greyscale
pass the values \code{0} and \code{255} respectively.
\end{funcdesc}

\begin{funcdesc}{grey2grey4}{image\, width\, height}
Convert an 8-bit greyscale image to a 4-bit greyscale image without
dithering.
\end{funcdesc}

\begin{funcdesc}{grey2grey2}{image\, width\, height}
Convert an 8-bit greyscale image to a 2-bit greyscale image without
dithering.
\end{funcdesc}

\begin{funcdesc}{dither2grey2}{image\, width\, height}
Convert an 8-bit greyscal...
...e{dither2mono}, the dithering algorithm is
currently very simple.
\end{funcdesc}

\begin{funcdesc}{grey42grey}{image\, width\, height}
Convert a 4-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc}

\begin{funcdesc}{grey22grey}{image\, width\, height}
Convert a 2-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc}